package uk.ac.ebi.das.uniprot.image.controller;

import org.apache.log4j.PropertyConfigurator;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Properties;
import java.io.IOException;

public class Log4JInit extends HttpServlet {

    public void init() {

        Properties log4jProps = new Properties();

        try {
            log4jProps.load(
                    getServletContext().getResourceAsStream(getServletConfig().getInitParameter("log4jLocation")));
        } catch (IOException e) {
            e.printStackTrace();
        }

        PropertyConfigurator.configure(log4jProps);
    }
}
